import {Component, OnInit, Input, Injector} from '@angular/core';
import { RecruitmentPlan } from '../../../domains/recruitmentplan.domain';
import {CoreComponent} from 'pengesoft-ng-lib';
import {RecruitmentPlanMgeSvrService} from '../../../services/recruitment-plan-mge-svr.service';

@Component({
  selector: 'app-recruitment-review',
  templateUrl: './recruitment-review.component.html',
  styleUrls: ['./recruitment-review.component.less']
})
export class RecruitmentReviewComponent extends CoreComponent implements OnInit {
  ishow1 = true;    // 控制组件的显示隐藏
  ishow2 = false;
  public infoList = {
    RecruitmentPlan: {},
    DeptList: [],
    Job: {},
    DeptIndex: 0,
  };

  @Input() info: any;       // 获取父组件传入信息
  constructor(private injector: Injector,
              public recruplanSvr: RecruitmentPlanMgeSvrService
             ){
               super(injector);
             }

  getInfo(data): void{
    this.infoList = data;
    this.ishow2 = true;
    this.ishow1 = false;
  }

  back(): void{
    this.ishow1 = true;
    this.ishow2 = false;
    this.recruplanSvr.getDetailList(new RecruitmentPlan()).then( res => {
      this.info = res;
    }, err => {
      this.nzMessageSvr.error(err.Msg);
    });
  }
  ngOnInit(): void {
  }
}
